package org.clockworkmages.games.anno1186.generator.sets;

import org.clockworkmages.games.anno1186.dao.GameObjectsList;
import org.clockworkmages.games.anno1186.generator.GameObjectGenerator;
import org.clockworkmages.games.anno1186.model.map.tactical.GameAreaDO;
import org.clockworkmages.games.anno1186.model.map.tactical.SimpleTileObject;

public class Tiles
		extends GameObjectGenerator {
	public String getFileName() {
		return "tiles";
	}

	@Override
	public GameObjectsList generate() {
		GameObjectsList gameObjects = new GameObjectsList();

		SimpleTileObject tileObject;
		tileObject = new SimpleTileObject("g", "tile-chalk", true);
		gameObjects.getTileObjects().add(tileObject);

		tileObject = new SimpleTileObject("npc_juan1", "hummie",
				"PALOS_TAVERN_JUAN");
		gameObjects.getTileObjects().add(tileObject);

		GameAreaDO gameAreaDO = new GameAreaDO();
		gameAreaDO.setId("palos_tavern");
		gameAreaDO.setX(7);
		gameAreaDO.setY(6);
		for (int y = 0; y < gameAreaDO.getY(); y++) {
			for (int x = 0; x < gameAreaDO.getX(); x++) {
				gameAreaDO.getTiles().add("g");
			}
		}

		gameAreaDO.getTiles().remove(7 * 1 - 1 + 2);
		gameAreaDO.getTiles().add(7 * 1 - 1 + 2, "npc_juan1");

		gameObjects.getGameAreas().add(gameAreaDO);

		return gameObjects;
	}

}
